package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpContractsQuoterListChangesPageUtil extends SeleniumPageUtil {
	public final static By CQL_DIV_RESULT= By.xpath("//*[@id='Quoter_QuoteList1_lblPaging']/div");
	public final static By CQL_TD_TITLE= By.xpath("//*[@id='Quoter_QuoteList1_pnlPage']/table/tbody/tr/td[4]");
	public final static By CQL_LIST_SCOPE= By.id("Quoter_QuoteList1_lblScope");
	public final static By CQL_FILTER_CONTRACTID = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[1]/div/img[1]");
	public final static By CQL_FILTER_TYPE = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[2]/div/img[1]");
	public final static By CQL_FILTER_CUSTOMER = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[5]/div/img[1]");
	public final static By CQL_FILTER_PARTNER = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[6]/div/img[1]");
	public final static By CQL_FILTER_END_CUSTOMER = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[7]/div/img[1]");
	public final static By CQL_FILTER_STATUS = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[8]/div/img[1]");
	public final static By CQL_IMG_STATUS = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[8]/div/img[2]");
	public final static By CQL_FILTER_CREATE_BY = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[9]/div/img[1]");
	public final static By CQL_FILTER_CREATE = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[10]/div/img[1]");
	public final static By CQL_FILTER_DUE_DATE = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[11]/div/img[1]");
	public final static By CQL_FILTER_CPN = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[12]/div/img[1]");
	public final static By CQL_FILTER_SALE_REP = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[13]/div/img[1]");
	public final static By CQL_FILTER_REV_STATUS = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[15]/div/img[1]");
	public final static By CQL_LINK_CONTRACTID = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[1]/a");
	public final static By CQL_LINK_TYPE = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[2]/a");
	public final static By CQL_LINK_CHANGES = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[3]/a");
	public final static By CQL_LINK_TEMP = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[4]/a");
	public final static By CQL_LINK_CUSTOMER = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[5]/a");
	public final static By CQL_LINK_PARTNER = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[6]/a");
	public final static By CQL_LINK_END_CUSTOMER = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[7]/a");
	public final static By CQL_LINK_STATUS = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[8]/a");
	public final static By CQL_LINK_CREATE_BY = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[9]/a");
	public final static By CQL_LINK_CREATE = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[10]/a");
	public final static By CQL_LINK_DUE_DATE = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[11]/a");
	public final static By CQL_LINK_CPN = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[12]/a");
	public final static By CQL_LINK_SALE_REP = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[13]/a");
	public final static By CQL_LINK_REVISION = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[14]/a");
	public final static By CQL_LINK_REV_STATUS = By.xpath("//*[@id='Quoter_QuoteList1_tblResults']/tbody/tr[2]/td[15]/a");
	public static void enter(){
		SpContractsQuoterPageUtil.enter();
		SpContractsQuoterPageUtil.displayHidenMenus(new By[]{SpContractsQuoterPageUtil.STQ_LINK_QUOTER});
		SeleniumUtil.waitOnElements(new By[]{SpContractsQuoterPageUtil.STQ_LINK_QUOTER_PROCESS_CHANGES});
		SeleniumUtil.click(SeleniumUtil.getCachedElement(SpContractsQuoterPageUtil.STQ_LINK_QUOTER_PROCESS_CHANGES));
		SeleniumUtil.waitForFixedMilliseconds(1000);
		waitForPageToLoad();
	}

	private static void waitForPageToLoad() {
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{
				CQL_LINK_CONTRACTID,CQL_LINK_REV_STATUS
		});
	}
}
